#ifndef NR_DEVICE_GROUP_H
#define NR_DEVICE_GROUP_H

#include "nr_device_item.h"

class nr_device_group : public nr_object
{
public:
    typedef QHash<nr_device_id_t, nr_device_group*> nr_device_group_hash; 
    
public:
    nr_device_group();
    
    nr_device_group(nr_device_group& group);

    nr_group_id_t& id();

    virtual ~nr_device_group();
    
    nr_device_group& operator = (nr_device_group &group);
    
    QString& name() { return m_name; }
    nr_device_group_hash& groups() { return m_device_groups; }
    nr_device_items& items() { return m_device_items; }
    
    virtual nr_device_item* find_device_item_by_id(const nr_device_id_t &device_id);

    virtual void serialize(QDataStream& data_stream);
    virtual void deserialize(QDataStream& data_stream);

protected:
    void copy_data(nr_device_group& group);

    nr_group_id_t m_id;
    QString m_name;
    nr_device_group_hash m_device_groups;
    nr_device_items m_device_items;
};

typedef nr_device_group::nr_device_group_hash nr_device_groups;


#endif // NR_DEVICE_GROUP_H
